import Vue from 'vue'
import VueRouter from 'vue-router'
import Index from '../views/Index.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'home',
    component: Index
  },
  {
    path: '/login',
    name: 'login',
    component: () => import('../views/Login.vue'),
  },
  {
    path: '/reg',
    name: 'register',
    component: () => import('../views/Register.vue'),
  },
  {
    path: '/ingredient',
    name: 'ingredient',
    component: () => import('../views/Ingredient.vue'),
  },
  {
    path: '/actives',
    name: 'actives',
    component: () => import('../views/Actives.vue'),
    children:[
      {
        path: 'br',
        name: 'batteryrecall',
        component: () => import('../views/BatteryRecall.vue'),
      },
    ]
  },
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
